<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../Vue.js/vue.js"></script>
</head>
<body>
    <div class="root">
        <h2>当前n的值是：  <span v-text = "n"></span></h2>
        <h2>放大10倍后的n值是: <span v-big = "n"></span></h2>
        <button @click="n++">点我n++</button>
    </div>
</body>
<script>
    const vm = new Vue({
        el: ".root",
        data: {
            n: 10
        },
        directives: {
            //调用： 指令与元素绑定时； 当指令所在模板被重新解析时。
            big(e, binding){
                e.innerText = binding.value * 10
            }
        }
    })
</script>
</html>